<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Irrlicht 3D Engine: irr::scene::ISceneCollisionManager Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="irrlichtlogo.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Irrlicht 3D Engine
   
   </div>
   
  </td>
  
  
  
   
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
   
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="dynsections.js"></script>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('classirr_1_1scene_1_1_i_scene_collision_manager.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">irr::scene::ISceneCollisionManager Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="irr::scene::ISceneCollisionManager" --><!-- doxytag: inherits="irr::IReferenceCounted" -->
<p>The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes.  
 <a href="classirr_1_1scene_1_1_i_scene_collision_manager.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_i_scene_collision_manager_8h_source.html">ISceneCollisionManager.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for irr::scene::ISceneCollisionManager:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
 <div class="center">
  <img src="classirr_1_1scene_1_1_i_scene_collision_manager.png" usemap="#irr::scene::ISceneCollisionManager_map" alt=""/>
  <map id="irr::scene::ISceneCollisionManager_map" name="irr::scene::ISceneCollisionManager_map">
<area href="classirr_1_1_i_reference_counted.html" title="Base class of most objects of the Irrlicht Engine." alt="irr::IReferenceCounted" shape="rect" coords="0,0,209,24"/>
</map>
 </div></div>

<p><a href="classirr_1_1scene_1_1_i_scene_collision_manager-members.html">List of all members.</a></p>
<h2><a name="pub-methods"></a>
Public Member Functions</h2>
<ul>
<li>virtual bool <a class="el" href="classirr_1_1scene_1_1_i_scene_collision_manager.html#a0adcf9dca228fac89b085144141f33b0">getCollisionPoint</a> (const <a class="el" href="classirr_1_1core_1_1line3d.html">core::line3d</a>&lt; <a class="el" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07">f32</a> &gt; &amp;ray, <a class="el" href="classirr_1_1scene_1_1_i_triangle_selector.html">ITriangleSelector</a> *selector, <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;outCollisionPoint, <a class="el" href="namespaceirr_1_1core.html#a1112835405bbec5dadf031dc7934e7d0">core::triangle3df</a> &amp;outTriangle, <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> *&amp;outNode)=0
<dl class="el"><dd class="mdescRight">Finds the nearest collision point of a line and lots of triangles, if there is one.  <a href="#a0adcf9dca228fac89b085144141f33b0"></a><br/></dl><li>virtual <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> <a class="el" href="classirr_1_1scene_1_1_i_scene_collision_manager.html#a4a1b1bdf49ec8dd3d4de8b502409ee00">getCollisionResultPosition</a> (<a class="el" href="classirr_1_1scene_1_1_i_triangle_selector.html">ITriangleSelector</a> *selector, const <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;ellipsoidPosition, const <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;ellipsoidRadius, const <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;ellipsoidDirectionAndSpeed, <a class="el" href="namespaceirr_1_1core.html#a1112835405bbec5dadf031dc7934e7d0">core::triangle3df</a> &amp;triout, <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;hitPosition, bool &amp;outFalling, <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> *&amp;outNode, <a class="el" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07">f32</a> slidingSpeed=0.0005f, const core::vector3df &amp;gravityDirectionAndSpeed=core::vector3df(0.0f, 0.0f, 0.0f))=0
<dl class="el"><dd class="mdescRight">Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid.  <a href="#a4a1b1bdf49ec8dd3d4de8b502409ee00"></a><br/></dl><li>virtual <a class="el" href="classirr_1_1core_1_1line3d.html">core::line3d</a>&lt; <a class="el" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07">f32</a> &gt; <a class="el" href="classirr_1_1scene_1_1_i_scene_collision_manager.html#adb95809ed422e138405f30844740666b">getRayFromScreenCoordinates</a> (const core::position2d&lt; <a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a> &gt; &amp;pos, <a class="el" href="classirr_1_1scene_1_1_i_camera_scene_node.html">ICameraSceneNode</a> *camera=0)=0
<dl class="el"><dd class="mdescRight">Returns a 3d ray which would go through the 2d screen coodinates.  <a href="#adb95809ed422e138405f30844740666b"></a><br/></dl><li>virtual <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> * <a class="el" href="classirr_1_1scene_1_1_i_scene_collision_manager.html#a25af822d52bce9acd88adfc7ce484982">getSceneNodeAndCollisionPointFromRay</a> (<a class="el" href="namespaceirr_1_1core.html#a384a3bb17659466af5521c7f74cfcea7">core::line3df</a> ray, <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;outCollisionPoint, <a class="el" href="namespaceirr_1_1core.html#a1112835405bbec5dadf031dc7934e7d0">core::triangle3df</a> &amp;outTriangle, <a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a> idBitMask=0, <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> *collisionRootNode=0, bool noDebugObjects=false)=0
<dl class="el"><dd class="mdescRight">Perform a ray/box and ray/triangle collision check on a heirarchy of scene nodes.  <a href="#a25af822d52bce9acd88adfc7ce484982"></a><br/></dl><li>virtual <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> * <a class="el" href="classirr_1_1scene_1_1_i_scene_collision_manager.html#ab29e0a261409a95a20e15ee09cc0de64">getSceneNodeFromCameraBB</a> (<a class="el" href="classirr_1_1scene_1_1_i_camera_scene_node.html">ICameraSceneNode</a> *camera, <a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a> idBitMask=0, bool bNoDebugObjects=false)=0
<dl class="el"><dd class="mdescRight">Get the scene node, which the given camera is looking at and whose id matches the bitmask.  <a href="#ab29e0a261409a95a20e15ee09cc0de64"></a><br/></dl><li>virtual <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> * <a class="el" href="classirr_1_1scene_1_1_i_scene_collision_manager.html#a420ffad2d3a8bcd2f51b504cb8709ac6">getSceneNodeFromRayBB</a> (const <a class="el" href="classirr_1_1core_1_1line3d.html">core::line3d</a>&lt; <a class="el" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07">f32</a> &gt; &amp;ray, <a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a> idBitMask=0, bool bNoDebugObjects=false, <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> *root=0)=0
<dl class="el"><dd class="mdescRight">Returns the nearest scene node which collides with a 3d ray and whose id matches a bitmask.  <a href="#a420ffad2d3a8bcd2f51b504cb8709ac6"></a><br/></dl><li>virtual <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> * <a class="el" href="classirr_1_1scene_1_1_i_scene_collision_manager.html#aca97a47ae237373bbd681268a462f4a0">getSceneNodeFromScreenCoordinatesBB</a> (const core::position2d&lt; <a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a> &gt; &amp;pos, <a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a> idBitMask=0, bool bNoDebugObjects=false, <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> *root=0)=0
<dl class="el"><dd class="mdescRight">Gets the scene node, which is currently visible under the given screencoordinates, viewed from the currently active camera.  <a href="#aca97a47ae237373bbd681268a462f4a0"></a><br/></dl><li>virtual core::position2d&lt; <a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a> &gt; <a class="el" href="classirr_1_1scene_1_1_i_scene_collision_manager.html#a6032377ff769e42c3e28547794f015ea">getScreenCoordinatesFrom3DPosition</a> (const <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;pos, <a class="el" href="classirr_1_1scene_1_1_i_camera_scene_node.html">ICameraSceneNode</a> *camera=0, bool useViewPort=false)=0
<dl class="el"><dd class="mdescRight">Calculates 2d screen position from a 3d position.  <a href="#a6032377ff769e42c3e28547794f015ea"></a><br/></dl></ul>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes. </p>

<p>Definition at line <a class="el" href="_i_scene_collision_manager_8h_source.html#l00024">24</a> of file <a class="el" href="_i_scene_collision_manager_8h_source.html">ISceneCollisionManager.h</a>.</p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a0adcf9dca228fac89b085144141f33b0"></a><!-- doxytag: member="irr::scene::ISceneCollisionManager::getCollisionPoint" ref="a0adcf9dca228fac89b085144141f33b0" args="(const core::line3d&lt; f32 &gt; &amp;ray, ITriangleSelector *selector, core::vector3df &amp;outCollisionPoint, core::triangle3df &amp;outTriangle, ISceneNode *&amp;outNode)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool irr::scene::ISceneCollisionManager::getCollisionPoint </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classirr_1_1core_1_1line3d.html">core::line3d</a>&lt; <a class="el" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07">f32</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>ray</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classirr_1_1scene_1_1_i_triangle_selector.html">ITriangleSelector</a> *&#160;</td>
          <td class="paramname"><em>selector</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;&#160;</td>
          <td class="paramname"><em>outCollisionPoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceirr_1_1core.html#a1112835405bbec5dadf031dc7934e7d0">core::triangle3df</a> &amp;&#160;</td>
          <td class="paramname"><em>outTriangle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> *&amp;&#160;</td>
          <td class="paramname"><em>outNode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Finds the nearest collision point of a line and lots of triangles, if there is one. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">ray,:</td><td>Line with which collisions are tested. </td></tr>
    <tr><td class="paramname">selector,:</td><td>TriangleSelector containing the triangles. It can be created for example using <a class="el" href="classirr_1_1scene_1_1_i_scene_manager.html#a266625379b1558e9be1dc062ea4e71f7" title="Creates a simple ITriangleSelector, based on a mesh.">ISceneManager::createTriangleSelector()</a> or ISceneManager::createTriangleOctreeSelector(). </td></tr>
    <tr><td class="paramname">outCollisionPoint,:</td><td>If a collision is detected, this will contain the position of the nearest collision to the line-start. </td></tr>
    <tr><td class="paramname">outTriangle,:</td><td>If a collision is detected, this will contain the triangle with which the ray collided. </td></tr>
    <tr><td class="paramname">outNode,:</td><td>If a collision is detected, this will contain the scene node associated with the triangle that was hit. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>True if a collision was detected and false if not. </dd></dl>

</div>
</div>
<a class="anchor" id="a4a1b1bdf49ec8dd3d4de8b502409ee00"></a><!-- doxytag: member="irr::scene::ISceneCollisionManager::getCollisionResultPosition" ref="a4a1b1bdf49ec8dd3d4de8b502409ee00" args="(ITriangleSelector *selector, const core::vector3df &amp;ellipsoidPosition, const core::vector3df &amp;ellipsoidRadius, const core::vector3df &amp;ellipsoidDirectionAndSpeed, core::triangle3df &amp;triout, core::vector3df &amp;hitPosition, bool &amp;outFalling, ISceneNode *&amp;outNode, f32 slidingSpeed=0.0005f, const core::vector3df &amp;gravityDirectionAndSpeed=core::vector3df(0.0f, 0.0f, 0.0f))=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> irr::scene::ISceneCollisionManager::getCollisionResultPosition </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classirr_1_1scene_1_1_i_triangle_selector.html">ITriangleSelector</a> *&#160;</td>
          <td class="paramname"><em>selector</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;&#160;</td>
          <td class="paramname"><em>ellipsoidPosition</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;&#160;</td>
          <td class="paramname"><em>ellipsoidRadius</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;&#160;</td>
          <td class="paramname"><em>ellipsoidDirectionAndSpeed</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceirr_1_1core.html#a1112835405bbec5dadf031dc7934e7d0">core::triangle3df</a> &amp;&#160;</td>
          <td class="paramname"><em>triout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;&#160;</td>
          <td class="paramname"><em>hitPosition</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool &amp;&#160;</td>
          <td class="paramname"><em>outFalling</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> *&amp;&#160;</td>
          <td class="paramname"><em>outNode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07">f32</a>&#160;</td>
          <td class="paramname"><em>slidingSpeed</em> = <code>0.0005f</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;&#160;</td>
          <td class="paramname"><em>gravityDirectionAndSpeed</em> = <code><a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a>(0.0f,&#160;0.0f,&#160;0.0f)</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid. </p>
<p>This can be used for moving a character in a 3d world: The character will slide at walls and is able to walk up stairs. The method used how to calculate the collision result position is based on the paper "Improved Collision detection and
		Response" by Kasper Fauerby. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">selector,:</td><td>TriangleSelector containing the triangles of the world. It can be created for example using <a class="el" href="classirr_1_1scene_1_1_i_scene_manager.html#a266625379b1558e9be1dc062ea4e71f7" title="Creates a simple ITriangleSelector, based on a mesh.">ISceneManager::createTriangleSelector()</a> or ISceneManager::createTriangleOctreeSelector(). </td></tr>
    <tr><td class="paramname">ellipsoidPosition,:</td><td>Position of the ellipsoid. </td></tr>
    <tr><td class="paramname">ellipsoidRadius,:</td><td>Radius of the ellipsoid. </td></tr>
    <tr><td class="paramname">ellipsoidDirectionAndSpeed,:</td><td>Direction and speed of the movement of the ellipsoid. </td></tr>
    <tr><td class="paramname">triout,:</td><td>Optional parameter where the last triangle causing a collision is stored, if there is a collision. </td></tr>
    <tr><td class="paramname">hitPosition,:</td><td>Return value for the position of the collision </td></tr>
    <tr><td class="paramname">outFalling,:</td><td>Is set to true if the ellipsoid is falling down, caused by gravity. </td></tr>
    <tr><td class="paramname">outNode,:</td><td>the node with which the ellipoid collided (if any) </td></tr>
    <tr><td class="paramname">slidingSpeed,:</td><td>DOCUMENTATION NEEDED. </td></tr>
    <tr><td class="paramname">gravityDirectionAndSpeed,:</td><td>Direction and force of gravity. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>New position of the ellipsoid. </dd></dl>

</div>
</div>
<a class="anchor" id="adb95809ed422e138405f30844740666b"></a><!-- doxytag: member="irr::scene::ISceneCollisionManager::getRayFromScreenCoordinates" ref="adb95809ed422e138405f30844740666b" args="(const core::position2d&lt; s32 &gt; &amp;pos, ICameraSceneNode *camera=0)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classirr_1_1core_1_1line3d.html">core::line3d</a>&lt;<a class="el" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07">f32</a>&gt; irr::scene::ISceneCollisionManager::getRayFromScreenCoordinates </td>
          <td>(</td>
          <td class="paramtype">const core::position2d&lt; <a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classirr_1_1scene_1_1_i_camera_scene_node.html">ICameraSceneNode</a> *&#160;</td>
          <td class="paramname"><em>camera</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a 3d ray which would go through the 2d screen coodinates. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pos,:</td><td>Screen coordinates in pixels. </td></tr>
    <tr><td class="paramname">camera,:</td><td>Camera from which the ray starts. If null, the active camera is used. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Ray starting from the position of the camera and ending at a length of the far value of the camera at a position which would be behind the 2d screen coodinates. </dd></dl>

</div>
</div>
<a class="anchor" id="a25af822d52bce9acd88adfc7ce484982"></a><!-- doxytag: member="irr::scene::ISceneCollisionManager::getSceneNodeAndCollisionPointFromRay" ref="a25af822d52bce9acd88adfc7ce484982" args="(core::line3df ray, core::vector3df &amp;outCollisionPoint, core::triangle3df &amp;outTriangle, s32 idBitMask=0, ISceneNode *collisionRootNode=0, bool noDebugObjects=false)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a>* irr::scene::ISceneCollisionManager::getSceneNodeAndCollisionPointFromRay </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceirr_1_1core.html#a384a3bb17659466af5521c7f74cfcea7">core::line3df</a>&#160;</td>
          <td class="paramname"><em>ray</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;&#160;</td>
          <td class="paramname"><em>outCollisionPoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceirr_1_1core.html#a1112835405bbec5dadf031dc7934e7d0">core::triangle3df</a> &amp;&#160;</td>
          <td class="paramname"><em>outTriangle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a>&#160;</td>
          <td class="paramname"><em>idBitMask</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> *&#160;</td>
          <td class="paramname"><em>collisionRootNode</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>noDebugObjects</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Perform a ray/box and ray/triangle collision check on a heirarchy of scene nodes. </p>
<p>This checks all scene nodes under the specified one, first by ray/bounding box, and then by accurate ray/triangle collision, finding the nearest collision, and the scene node containg it. It returns the node hit, and (via output parameters) the position of the collision, and the triangle that was hit.</p>
<p>All scene nodes in the hierarchy tree under the specified node are checked. Only nodes that are visible, with an ID that matches at least one bit in the supplied bitmask, and which have a triangle selector are considered as candidates for being hit. You do not have to build a meta triangle selector; the individual triangle selectors of each candidate scene node are used automatically.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">ray,:</td><td>Line with which collisions are tested. </td></tr>
    <tr><td class="paramname">outCollisionPoint,:</td><td>If a collision is detected, this will contain the position of the nearest collision. </td></tr>
    <tr><td class="paramname">outTriangle,:</td><td>If a collision is detected, this will contain the triangle with which the ray collided. </td></tr>
    <tr><td class="paramname">idBitMask,:</td><td>Only scene nodes with an id which matches at least one of the bits contained in this mask will be tested. However, if this parameter is 0, then all nodes are checked. </td></tr>
    <tr><td class="paramname">collisionRootNode,:</td><td>the scene node at which to begin checking. Only this node and its children will be checked. If you want to check the entire scene, pass 0, and the root scene node will be used (this is the default). </td></tr>
    <tr><td class="paramname">noDebugObjects,:</td><td>when true, debug objects are not considered viable targets. Debug objects are scene nodes with IsDebugObject() = true. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the scene node containing the hit triangle nearest to ray.start. If no collision is detected, then 0 is returned. </dd></dl>

</div>
</div>
<a class="anchor" id="ab29e0a261409a95a20e15ee09cc0de64"></a><!-- doxytag: member="irr::scene::ISceneCollisionManager::getSceneNodeFromCameraBB" ref="ab29e0a261409a95a20e15ee09cc0de64" args="(ICameraSceneNode *camera, s32 idBitMask=0, bool bNoDebugObjects=false)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a>* irr::scene::ISceneCollisionManager::getSceneNodeFromCameraBB </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classirr_1_1scene_1_1_i_camera_scene_node.html">ICameraSceneNode</a> *&#160;</td>
          <td class="paramname"><em>camera</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a>&#160;</td>
          <td class="paramname"><em>idBitMask</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>bNoDebugObjects</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the scene node, which the given camera is looking at and whose id matches the bitmask. </p>
<p>A ray is simply casted from the position of the camera to the view target position, and all scene nodes are tested against this ray. The collision tests are done using a bounding box for each scene node. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">camera,:</td><td>Camera from which the ray is casted. </td></tr>
    <tr><td class="paramname">idBitMask,:</td><td>Only scene nodes with an id which matches at least one of the bits contained in this mask will be tested. However, if this parameter is 0, then all nodes are checked. feature is disabled. Please note that the default node id of -1 will match with every bitmask != 0 </td></tr>
    <tr><td class="paramname">bNoDebugObjects,:</td><td>Doesn't take debug objects into account when true. These are scene nodes with IsDebugObject() = true. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Scene node nearest to the camera, which collides with the ray and matches the idBitMask, if the mask is not null. If no scene node is found, 0 is returned. </dd></dl>

</div>
</div>
<a class="anchor" id="a420ffad2d3a8bcd2f51b504cb8709ac6"></a><!-- doxytag: member="irr::scene::ISceneCollisionManager::getSceneNodeFromRayBB" ref="a420ffad2d3a8bcd2f51b504cb8709ac6" args="(const core::line3d&lt; f32 &gt; &amp;ray, s32 idBitMask=0, bool bNoDebugObjects=false, ISceneNode *root=0)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a>* irr::scene::ISceneCollisionManager::getSceneNodeFromRayBB </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classirr_1_1core_1_1line3d.html">core::line3d</a>&lt; <a class="el" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07">f32</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>ray</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a>&#160;</td>
          <td class="paramname"><em>idBitMask</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>bNoDebugObjects</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> *&#160;</td>
          <td class="paramname"><em>root</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the nearest scene node which collides with a 3d ray and whose id matches a bitmask. </p>
<p>The collision tests are done using a bounding box for each scene node. The recursive search can be limited be specifying a scene node. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">ray</td><td>Line with which collisions are tested. </td></tr>
    <tr><td class="paramname">idBitMask</td><td>Only scene nodes with an id which matches at least one of the bits contained in this mask will be tested. However, if this parameter is 0, then all nodes are checked. </td></tr>
    <tr><td class="paramname">bNoDebugObjects,:</td><td>Doesn't take debug objects into account when true. These are scene nodes with IsDebugObject() = true. </td></tr>
    <tr><td class="paramname">root</td><td>If different from 0, the search is limited to the children of this node. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Scene node nearest to ray.start, which collides with the ray and matches the idBitMask, if the mask is not null. If no scene node is found, 0 is returned. </dd></dl>

</div>
</div>
<a class="anchor" id="aca97a47ae237373bbd681268a462f4a0"></a><!-- doxytag: member="irr::scene::ISceneCollisionManager::getSceneNodeFromScreenCoordinatesBB" ref="aca97a47ae237373bbd681268a462f4a0" args="(const core::position2d&lt; s32 &gt; &amp;pos, s32 idBitMask=0, bool bNoDebugObjects=false, ISceneNode *root=0)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a>* irr::scene::ISceneCollisionManager::getSceneNodeFromScreenCoordinatesBB </td>
          <td>(</td>
          <td class="paramtype">const core::position2d&lt; <a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a>&#160;</td>
          <td class="paramname"><em>idBitMask</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>bNoDebugObjects</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classirr_1_1scene_1_1_i_scene_node.html">ISceneNode</a> *&#160;</td>
          <td class="paramname"><em>root</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Gets the scene node, which is currently visible under the given screencoordinates, viewed from the currently active camera. </p>
<p>The collision tests are done using a bounding box for each scene node. You can limit the recursive search so just all children of the specified root are tested. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pos,:</td><td>Position in pixel screen coordinates, under which the returned scene node will be. </td></tr>
    <tr><td class="paramname">idBitMask,:</td><td>Only scene nodes with an id with bits set like in this mask will be tested. If the BitMask is 0, this feature is disabled. Please note that the default node id of -1 will match with every bitmask != 0 </td></tr>
    <tr><td class="paramname">bNoDebugObjects,:</td><td>Doesn't take debug objects into account when true. These are scene nodes with IsDebugObject() = true. </td></tr>
    <tr><td class="paramname">root</td><td>If different from 0, the search is limited to the children of this node. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Visible scene node under screen coordinates with matching bits in its id. If there is no scene node under this position, 0 is returned. </dd></dl>

</div>
</div>
<a class="anchor" id="a6032377ff769e42c3e28547794f015ea"></a><!-- doxytag: member="irr::scene::ISceneCollisionManager::getScreenCoordinatesFrom3DPosition" ref="a6032377ff769e42c3e28547794f015ea" args="(const core::vector3df &amp;pos, ICameraSceneNode *camera=0, bool useViewPort=false)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual core::position2d&lt;<a class="el" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6">s32</a>&gt; irr::scene::ISceneCollisionManager::getScreenCoordinatesFrom3DPosition </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">core::vector3df</a> &amp;&#160;</td>
          <td class="paramname"><em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classirr_1_1scene_1_1_i_camera_scene_node.html">ICameraSceneNode</a> *&#160;</td>
          <td class="paramname"><em>camera</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>useViewPort</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Calculates 2d screen position from a 3d position. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pos,:</td><td>3D position in world space to be transformed into 2d. </td></tr>
    <tr><td class="paramname">camera,:</td><td>Camera to be used. If null, the currently active camera is used. </td></tr>
    <tr><td class="paramname">useViewPort,:</td><td>Calculate screen coordinates relative to the current view port. Please note that unless the driver does not take care of the view port, it is usually best to get the result in absolute screen coordinates (flag=false). </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>2d screen coordinates which a object in the 3d world would have if it would be rendered to the screen. If the 3d position is behind the camera, it is set to (-1000,-1000). In most cases you can ignore this fact, because if you use this method for drawing a decorator over a 3d object, it will be clipped by the screen borders. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_i_scene_collision_manager_8h_source.html">ISceneCollisionManager.h</a></li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceirr.html">irr</a>      </li>
      <li class="navelem"><a class="el" href="namespaceirr_1_1scene.html">scene</a>      </li>
      <li class="navelem"><a class="el" href="classirr_1_1scene_1_1_i_scene_collision_manager.html">ISceneCollisionManager</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">
<a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht 
Engine</a> Documentation &copy; 2003-2012 by Nikolaus Gebhardt. Generated on Sat Jul 9 2016 18:18:39 for Irrlicht 3D Engine by
<a href="http://www.doxygen.org/index.html" target="_blank">Doxygen</a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
